package ObjectsPlus_extends.S.T.Keywords;

public class B_Person {
    private String name;
    private int age;

    public B_Person() {
    }

    public B_Person(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public void keepPet(B_Cats dog, String something){
        System.out.println("颜色为" + dog.getColor() + "的" + dog.getAge() +"岁的狗，在吃" + something);
    }

    public void keepPet(B_Dogs cat, String something){
        System.out.println("颜色为" + cat.getColor() + "的" + cat.getAge() +"岁的猫，在吃" + something);
    }
}
